package com.battery.system.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.battery.common.annotation.Excel;
import com.battery.common.core.domain.BaseEntity;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 支付订单对象 ws_order
 *
 * @author battery
 * @date 2021-01-22
 */
@Table(name = "ws_order")
public class Order {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @Id
    @KeySql(useGeneratedKeys = true)
    private String id;

    /**
     * 订单渠道 微信 1 支付宝 2
     */
    @Excel(name = "订单渠道 微信 1 支付宝 2")
    private Integer channel;

    /**
     * 用户ID
     */
    @Excel(name = "用户ID")
    private String appUserId;

    /**
     * 微信商户服务订单号 或 支付宝商户授权资金订单号
     */
    @Excel(name = "微信商户服务订单号 或 支付宝商户授权资金订单号")
    private String outOrderNo;

    /**
     * 微信结单交易单号 同 支付宝trade_no支付宝交易号
     */
    @Excel(name = "微信结单交易单号 同 支付宝trade_no支付宝交易号")
    private String transactionId;

    /**
     * 金额
     */
    @Excel(name = "金额")
    private BigDecimal totalFee;

    /**
     * 支付状态0—未支付1—支付成功2—转入退款3—退款成功4—退款异常5—退款关闭6—已关闭7--支付失败(其他原因，如银行返回失败)
     */
    @Excel(name = "支付状态0—未支付1—支付成功2—转入退款3—退款成功4—退款异常5—退款关闭6—已关闭7--支付失败(其他原因，如银行返回失败)")
    private Integer tradeState;

    /**
     * 扩展参数
     */
    @Excel(name = "扩展参数")
    private String extend;

    /**
     * 创建订单时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建订单时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    /**
     * 支付成功时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "支付成功时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date payTime;

    /**
     * 是否已使用 1 已使用 0 未使用完毕 用于押金
     */
    @Excel(name = "是否已使用 1 已使用 0 未使用完毕 用于押金")
    private Integer isUsed;

    /**
     * 项目ID
     */
    @Excel(name = "项目ID")
    private String projectId;

    /**
     * 直属合作商ID
     */
    @Excel(name = "直属合作商ID")
    private String partnerId;

    /**
     * 直属商户ID
     */
    @Excel(name = "直属商户ID")
    private String merchantId;

    /**
     * 门店ID
     */
    @Excel(name = "门店ID")
    private String storeId;

    /**
     * 退款金额
     */
    @Excel(name = "退款金额")
    private BigDecimal refundMoney;

    /**
     * 退款单号ID
     */
    @Excel(name = "退款单号ID")
    private String refundId;

    /**
     * 订单类型:1 押金2 机柜租赁费用3 线租借费用
     */
    @Excel(name = "订单类型:1 押金2 机柜租赁费用3 线租借费用")
    private Integer orderType;

    /**
     * 支付类型：1\押金2\支付宝预授权3\微信支付分4\支付宝支付5\微信支付
     */
    @Excel(name = "支付类型")
    private Integer payType;

    private String sn;

    // 租借订单ID
    private String usedId;


    private Date refundTime;


    private String refundDesc;

    // 0 未标记 1 已标记  用于押金
    private Integer isDepositSign;


    public Integer getIsDepositSign() {
        return isDepositSign;
    }

    public void setIsDepositSign(Integer isDepositSign) {
        this.isDepositSign = isDepositSign;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setChannel(Integer channel) {
        this.channel = channel;
    }

    public Integer getChannel() {
        return channel;
    }

    public void setAppUserId(String appUserId) {
        this.appUserId = appUserId;
    }

    public String getAppUserId() {
        return appUserId;
    }

    public void setOutOrderNo(String outOrderNo) {
        this.outOrderNo = outOrderNo;
    }

    public String getOutOrderNo() {
        return outOrderNo;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setTotalFee(BigDecimal totalFee) {
        this.totalFee = totalFee;
    }

    public BigDecimal getTotalFee() {
        return totalFee;
    }

    public void setTradeState(Integer tradeState) {
        this.tradeState = tradeState;
    }

    public Integer getTradeState() {
        return tradeState;
    }

    public void setExtend(String extend) {
        this.extend = extend;
    }

    public String getExtend() {
        return extend;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setIsUsed(Integer isUsed) {
        this.isUsed = isUsed;
    }

    public Integer getIsUsed() {
        return isUsed;
    }

    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    public String getProjectId() {
        return projectId;
    }

    public void setPartnerId(String partnerId) {
        this.partnerId = partnerId;
    }

    public String getPartnerId() {
        return partnerId;
    }

    public void setMerchantId(String merchantId) {
        this.merchantId = merchantId;
    }

    public String getMerchantId() {
        return merchantId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public String getStoreId() {
        return storeId;
    }

    public void setRefundMoney(BigDecimal refundMoney) {
        this.refundMoney = refundMoney;
    }

    public BigDecimal getRefundMoney() {
        return refundMoney;
    }

    public void setRefundId(String refundId) {
        this.refundId = refundId;
    }

    public String getRefundId() {
        return refundId;
    }

    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }

    public Integer getOrderType() {
        return orderType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public Integer getPayType() {
        return payType;
    }

    public String getUsedId() {
        return usedId;
    }

    public void setUsedId(String usedId) {
        this.usedId = usedId;
    }

    public Date getRefundTime() {
        return refundTime;
    }

    public void setRefundTime(Date refundTime) {
        this.refundTime = refundTime;
    }

    public String getRefundDesc() {
        return refundDesc;
    }

    public void setRefundDesc(String refundDesc) {
        this.refundDesc = refundDesc;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("channel", getChannel())
                .append("appUserId", getAppUserId())
                .append("outOrderNo", getOutOrderNo())
                .append("transactionId", getTransactionId())
                .append("totalFee", getTotalFee())
                .append("tradeState", getTradeState())
                .append("extend", getExtend())
                .append("createdTime", getCreatedTime())
                .append("payTime", getPayTime())
                .append("isUsed", getIsUsed())
                .append("projectId", getProjectId())
                .append("partnerId", getPartnerId())
                .append("merchantId", getMerchantId())
                .append("storeId", getStoreId())
                .append("refundMoney", getRefundMoney())
                .append("refundId", getRefundId())
                .append("orderType", getOrderType())
                .append("payType", getPayType())
                .toString();
    }
}
